import { USERINFO, USERPROFILE } from './constants'
export default function userReducer(pre = { user: {}, profile: {} }, action) {
  if (action.type === USERINFO) {
    return { ...pre, user: action.data }
  } else if (action.type === USERPROFILE) {
    return { ...pre, profile: action.data }
  }
  return pre
}
